<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html">
<body>

This text above will not be displayed.

<ui:composition template="/WEB-INF/layout/template.xhtml">
<ui:define name="phaseListener">
</ui:define>
This text will not be displayed.

  <ui:define name="title">
    ryan.log
  </ui:define>
  <ui:define name="secondaryContent">
  	<ui:include src="secondaryContent.xhtml" />
  </ui:define>

This text will not be displayed.
	<ui:define name="primaryContent">
		<div id="primaryContent">
		<h2>新增分类</h2>
		<h:form id="new_cat">
		<h:panelGrid columns="2">
		<h:outputLabel value="请输入分类名称:" for="cat_name"></h:outputLabel> <h:inputText id="cat_name" value="#{catPage.name}" rendered="true"></h:inputText>
		<h:outputLabel value="请输入分类描述:" for="cat_des"></h:outputLabel> <h:inputText id="cat_des" value="#{catPage.des}"  ></h:inputText>
		<h:commandButton action="#{catPage.addCatAction}" value="提交"></h:commandButton>
		</h:panelGrid>
		</h:form>
		</div>
		<div id="primaryContent">
		<h2>文章分类</h2>
		<h:form id="cat_form">
			<h:dataTable id="cat_data" value="#{homePage.categories}" var="cat" binding="#{catPage.data}">
				<h:column>
					<f:facet name="header">名称</f:facet>
					<h:outputText value="#{cat.name}" style="width:200px"></h:outputText>
				</h:column>
				<h:column>
					<f:facet name="header">描述</f:facet>
					<h:outputText value="#{cat.description}" style="width:400px"></h:outputText>
				</h:column>
				<h:column>
					<f:facet name="header">管理</f:facet>
					<h:commandButton styleClass="button" id="edit" action="#{catPage.editCatAction}" value="编辑"></h:commandButton>
					<h:commandButton styleClass="button" id="del" action="#{catPage.deleteCatAction}" value="删除" onclick="return confirm('确认删除?');"></h:commandButton>
				</h:column>
			</h:dataTable>
		</h:form>
		</div>
	</ui:define>
  
</ui:composition>

This text below will also not be displayed.

</body>
</html>